package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.business.firefightingplan;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.business.firefightingplan.FirefightingplanService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 消防平面图控制器
 */
@Action
@RequestMapping(value="business/firefightingplan")
public class FirefightingplanController extends BaseController {
    @Resource
    public FirefightingplanService firefightingplanService;

    /**
     * @Author YangYu
     * @Description 楼栋分页列表
     * @Date Created in 9:24 2022/7/26
     * @Param [jsonParam]
     */

    @At(value = "floorListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity floorListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.floorListPage(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 楼栋新增、编辑
     * @Date Created in 9:25 2022/7/26
     * @Param [jsonParam]
     */

    @At(value = "floorAddOrUpdate", method = RequestMethod.POST, param = { "name"})
    public RespEntity floorAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.floorAddOrUpdate(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 楼栋删除
     * @Date Created in 9:25 2022/7/26
     * @Param [jsonParam]
     */

    @At(value = "floorDel", method = RequestMethod.POST, param = { "id"})
    public RespEntity floorDel(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.floorDel(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 楼层分页列表
     * @Date Created in 9:24 2022/7/26
     * @Param [jsonParam]
     */

    @At(value = "storeyListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity storeyListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.storeyListPage(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 楼层详情
     * @Date Created in 9:28 2022/7/26
     * @Param [jsonParam]
     */

    @At(value = "storeyDetails", method = RequestMethod.GET, param = { "id"})
    public RespEntity storeyDetails(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.storeyDetails(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 楼层新增、编辑
     * @Date Created in 9:25 2022/7/26
     * @Param [jsonParam]
     */

    @At(value = "storeyAddOrUpdate", method = RequestMethod.POST)
    public RespEntity storeyAddOrUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.storeyAddOrUpdate(jsonParam);
    }
    /**
     * @Author YangYu
     * @Description 楼层删除
     * @Date Created in 9:25 2022/7/26
     * @Param [jsonParam]
     */

    @At(value = "storeyDel", method = RequestMethod.POST)
    public RespEntity storeyDel(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.storeyDel(jsonParam);
    }

    /**
     * 消防平面图列表
     * @param
     * page	第几页
     * limit	每页多少条
     * type	类别：对应字典表数据
     * businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * createyear	创建年份
     * @return
     */
    @At(value = "firefightingplanListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity firefightingplanListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.firefightingplanListPage(jsonParam);
    }

    /**
     * 消防平面图详情
     * @param  id	消防平面图的id
     * @return
     */
    @At(value = "firefightingplanDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity firefightingplanDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.firefightingplanDetail(jsonParam);
    }

    /**
     * 消防平面图新增
     * @param
     * type	类别id
     * name	名称
     * fileName	附件名称
     * filePath	附件路径
     * @return
     */
    @At(value = "firefightingplanAdd", method = RequestMethod.POST, param = { "type"})
    public RespEntity firefightingplanAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.firefightingplanAdd(jsonParam);
    }

    /**
     * 消防平面图修改
     * @param
     * type	类别id
     * name	名称
     * fileName	附件名称
     * id	消防平面图id
     * filePath	附件路径
     * @return
     */
    @At(value = "firefightingplanUpdate", method = RequestMethod.POST, param = { "id","type" })
    public RespEntity firefightingplanUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.firefightingplanUpdate(jsonParam);
    }

    /**
     * 消防平面图删除
     * @param   id	消防平面图的id
     * @return
     */
    @At(value = "firefightingplanDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity firefightingplanDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return firefightingplanService.firefightingplanDelete(jsonParam);
    }






   
}
